package com.eddie.facade;

/**
 * Facade 外观类
 * @author Eddie
 * @date 2022/08/02 09:23
 **/
public class HomeTheaterFacade {

    /**
     * 定义各个子系统对象
     */
    private final TheatreLight theatreLight = TheatreLight.getInstance();
    private final Popcorn popcorn = Popcorn.getInstance();
    private final Stereo stereo = Stereo.getInstance();
    private final Projector projector = Projector.getInstance();
    private final Screen screen = Screen.getInstance();
    private final DVEPlayer dvePlayer = DVEPlayer.getInstance();

    public void ready() {
        projector.on();
        popcorn.play();
        screen.down();
        projector.on();
        stereo.on();
        dvePlayer.on();
        theatreLight.dim();
    }

    public void play() {
        dvePlayer.play();
    }

    public void pause() {
        dvePlayer.off();
    }

    public void end() {
        projector.off();
        popcorn.off();
        screen.up();
        projector.off();
        stereo.off();
        dvePlayer.off();
        theatreLight.off();
    }


}
